#!/usr/bin/env bash
#function:  add  RPM-GPG-KEY 
#parmeter:
#author: yeslf 
#version: 1.0
#Test: CentOS 6 



cat  >/etc/pki/rpm-gpg/RPM-GPG-KEY-remi<</
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.7 (GNU/Linux)

mQGiBEJny1wRBACRnbQgZ6qLmJSuGvi/EwrRL6aW610BbdpLQRL3dnwy5wI5t9T3
/JEiEJ7GTvAwfiisEHifMfk2sRlWRf2EDQFttHyrrYXfY5L6UAF2IxixK5FL7PWA
/2a7tkw1IbCbt4IGG0aZJ6/xgQejrOLi4ewniqWuXCc+tLuWBZrGpE2QfwCggZ+L
0e6KPTHMP97T4xV81e3Ba5MD/3NwOQh0pVvZlW66Em8IJnBgM+eQh7pl4xq7nVOh
dEMJwVU0wDRKkXqQVghOxALOSAMapj5mDppEDzGLZHZNSRcvGEs2iPwo9vmY+Qhp
AyEBzE4blNR8pwPtAwL0W3cBKUx7ZhqmHr2FbNGYNO/hP4tO2ochCn5CxSwAfN1B
Qs5pBACOkTZMNC7CLsSUT5P4+64t04x/STlAFczEBcJBLF1T16oItDITJmAsPxbY
iee6JRfXmZKqmDP04fRdboWMcRjfDfCciSdIeGqP7vMcO25bDZB6x6++fOcmQpyD
1Fag3ZUq2yojgXWqVrgFHs/HB3QE7UQkykNp1fjQGbKK+5mWTrQkUmVtaSBDb2xs
ZXQgPFJQTVNARmFtaWxsZUNvbGxldC5jb20+iGAEExECACAFAkZ+MYoCGwMGCwkI
BwMCBBUCCAMEFgIDAQIeAQIXgAAKCRAATm9HAPl/Vv/UAJ9EL8ioMTsz/2EPbNuQ
MP5Xx/qPLACeK5rk2hb8VFubnEsbVxnxfxatGZ25AQ0EQmfLXRAEANwGvY+mIZzj
C1L5Nm2LbSGZNTN3NMbPFoqlMfmym8XFDXbdqjAHutGYEZH/PxRI6GC8YW5YK4E0
HoBAH0b0F97JQEkKquahCakj0P5mGuH6Q8gDOfi6pHimnsSAGf+D+6ZwAn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a6JhJxe91V0vAxR
9tBx2KLkl4uYHJELoH9JOcv4WMFMgdoA2MjcIzhH5Cc4t+vQC2cK8lLT7IiGfI57
vhFCsz+GEqHusDfQgLAp0onI9wwCUwtiFZh4jMOJvk6HMGaGVSP30zh1bGqIPjFS
qk7agVI=
=sJgk
-----END PGP PUBLIC KEY BLOCK-----
/

ls -l /etc/pki/rpm-gpg/RPM-GPG-KEY-remi*


cat >/etc/yum.repos.d/remi-php56.repo<</
#http://mirrors.aliyun.com/remi/enterprise
#https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/

[remi-php56]
name=Remi's PHP 5.6 RPM repository for Enterprise Linux 6 - $basearch
baseurl=http://mirrors.aliyun.com/remi/enterprise/6/php56/\$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

[remi-safe]
name=Safe Remi's RPM repository for Enterprise Linux 6 - $basearch
baseurl=http://mirrors.aliyun.com/remi/enterprise/6/safe/\$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
/